package leetcode.code0145;

import java.util.ArrayList;
import java.util.List;

import leetcode.IDebug;
import leetcode.helper.tree.TreeNode;

public class Solution implements IDebug {

	List<Integer> ans;

	public List<Integer> postorderTraversal(TreeNode root) {
		ans = new ArrayList<>();
		this.find(root);
		return ans;
	}

	private void find(TreeNode root) {
		if (root == null) {
			return;
		}
		this.find(root.left);
		this.find(root.right);
		ans.add(root.val);
	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
